#pragma once

#include <sys_def.h>
#include <sys_usb.h>

typedef enum {
	USB_STD_REQ_RECIPIENT_DEV = 0,
	USB_STD_REQ_RECIPIENT_INTF = 1,
	USB_STD_REQ_RECIPIENT_EP = 2,
	USB_STD_REQ_RECIPIENT_OTHER = 3,
} usb_std_req_recipient_e;

typedef enum {
	USB_STD_REQ_TYPE_STD = 0,
	USB_STD_REQ_TYPE_CLASS = 1,
	USB_STD_REQ_TYPE_VENDOR = 2,
	USB_STD_REQ_TYPE_OTHER = 3,
} usb_std_req_type_e;

typedef struct {
	usb_std_req_recipient_e recipient : 5;
	usb_std_req_type_e type : 2;
	usb_dir_e dir : 1;
	u8_s cmd;
	u16_s para;
	u16_s idx;
	u16_s len;
} usb_std_req_t;

_Static_assert(sizeof(usb_std_req_t) == 8,
	       "Struct usb_std_req_t defined error!");
